// 表单字段类型定义
const FormDataType = [
    "number",    // id
    "string",    // driverId
    "string",    // content
    "number",    // tradeType
    "number",    // amount
    "string",    // tradeNo
    "dateTime",    // createTime
    "dateTime",    // updateTime
    "boolean"     // isDeleted
];

// 表单默认数据
const FormData = {
    id: null,
    driverId: "",
    content: "",
    tradeType: null,
    amount: null,
    tradeNo: "",
    createTime: "",
    updateTime: "",
    isDeleted: null
};

// 字段标签
const labels = {
    id: "编号",
    driverId: "司机id",
    content: "交易内容",
    tradeType: "交易类型",
    amount: "金额",
    tradeNo: "交易编号",
    createTime: "创建时间",
    updateTime: "修改时间",
    isDeleted: "是否删除"
};

// 选项配置
const options = {
    tradeType: [
        { value: 1, label: "奖励" },
        { value: 2, label: "补贴" },
        { value: 3, label: "提现" }
    ],
    isDeleted: [
        { value: 1, label: "已删除" },
        { value: 0, label: "未删除" }
    ]
};

// 表格列配置
const tableColumns = [
    { prop: "id", label: "编号", sortable: true, align: "center" },
    { prop: "driverId", label: "司机id", align: "center" },
    { prop: "content", label: "交易内容", align: "center" },
    {
        prop: "tradeType",
        label: "交易类型",
        align: "center",
        formatter: (row) => {
            switch(row.tradeType) {
                case 1: return "奖励";
                case 2: return "补贴";
                case 3: return "提现";
                default: return row.tradeType;
            }
        }
    },
    { prop: "amount", label: "金额", align: "center" },
    { prop: "tradeNo", label: "交易编号", align: "center" },
    { prop: "createTime", label: "创建时间", sortable: true, align: "center" },
    { prop: "updateTime", label: "修改时间", sortable: true, align: "center" },
    {
        prop: "isDeleted",
        label: "是否删除",
        align: "center",
        formatter: (row) => row.isDeleted === 1 ? "已删除" : "未删除"
    }
];

// 统一导出配置
export const DriverTradeRecordTableConfig = {
    FormData,
    FormDataType,
    labels,
    options,
    tableColumns
};

export default DriverTradeRecordTableConfig;